import createVue from '@/main'
import createRouter from '@/router'
import views from './views'
import BaiduMap from 'vue-baidu-map'

Vue.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'YOUR_APP_KEY'
})

import VueAMap from 'vue-amap';
Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
  key: '2f06ff750556c642f3a4304588e03b18',
  plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'ToolBar', 'MapType', 'PolyEditor', 'Geocoder', 'ContextMenu'],
  // 默认高德 sdk 版本为 1.4.4
  v: '1.4.4'
});
import { lazyAMapApiLoaderInstance } from "vue-amap";
Vue.prototype.$lazyAMapApiLoaderInstance = lazyAMapApiLoaderInstance;


import * as L from "leaflet";
import "leaflet/dist/leaflet.css";
// 绘制、编辑、拖动、点击即清除图形
import "leaflet.pm";
import "leaflet.pm/dist/leaflet.pm.css";
// 包含各种中国瓦片供应商的配置——天地图、MapABC、高德等。Leaflet.ChineseTmsProviders
import "leaflet.chinatmsproviders";
// 聚合点
import "leaflet.markercluster";
import "leaflet.markercluster/dist/MarkerCluster.css";
import "leaflet.markercluster/dist/MarkerCluster.Default.css";

import 'leaflet-draw';
import "./Leaflet.Editable";
import 'leaflet.path.drag';

import 'leaflet-measure-path';
import 'leaflet-measure-path/leaflet-measure-path.css';

Vue.config.productionTip = false;
Vue.L = Vue.prototype.$L = L;

/* leaflet icon */
delete L.Icon.Default.prototype._getIconUrl;
L.Icon.Default.mergeOptions({
  iconRetinaUrl: require("leaflet/dist/images/marker-icon-2x.png"),
  iconUrl: require("leaflet/dist/images/marker-icon.png"),
  shadowUrl: require("leaflet/dist/images/marker-shadow.png"),
});
createVue(createRouter(views))